export const state = () => ({
  token: ''
});

export const mutations = {
  init(state, token) {
    console.log("设置了token", token);
    state.token = token;
  }
};

export const getters = {
  isLogin(state) {
    return !!state.token;
  }
};

export const actions = {
  login({ commit, getters }, u) {
    commit("init", "token");
  }
};
